package com.appcenter.application.mapper;

import com.appcenter.application.input.User.GetUsersInput;
import com.appcenter.application.model.Orgs;
import com.appcenter.application.model.Permissions;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

@org.apache.ibatis.annotations.Mapper
@Repository
public interface OrgsMapper extends Mapper<Orgs> {

    //查询当前应用下最大排序值
    @Select("select * FROM orgs WHERE ParentId=#{ParentId} ORDER BY ListOrder DESC limit 0,1")
    public Orgs maxListOrder(String ParentId);

    @Select("SELECT * from  orgs WHERE OrgCode=#{OrgCode} AND Appcode is #{AppCode}")
    public List<Orgs> getOrgsByOrgCode(GetUsersInput input);
}
